package com.itheima.包装类;

/**
 * @Author 王加鑫
 * @Date 2021/5/10 14:57
 * @Version 1.0
 */
public class IntegerTest1 {
    public static void main(String[] args) {
        //装箱:将一个基本数据类型转为对应的包装类类型
        int a = 10;
        //手动装箱
        Integer b = Integer.valueOf(a);
        //自动装箱
        Integer c = a;
        System.out.println(b);
        System.out.println(c);


        //拆箱:将一个包装类类型转为对应的基本数据类型
        Integer d = new Integer(10);
        //手动拆箱
        int num = d.intValue();
        //自动拆箱
        int num1 = d;
        System.out.println(num);
        System.out.println(num1);
        int num2 = 10;
        String s3 = Integer.toString(num2);


    }
}
